/* Replication Material for Figure 1 international

De Vries, Hobolt and Walter (2021): Politicizing International Cooperation. The Mass Public, Political Entrepreneurs and Political Opportunity Structures. International Organization
*/


do "/Users/walter/Documents/Research/Econometrics/STATA Code/ciplotm.do"

clear
use "/Users/walter/Dropbox/ISSP_DATA/ISSP2013_selectedvars.dta"
append using "/Users/walter/Dropbox/ISSP_DATA/ISSP2003_selectedvars.dta", generate(y2003) force
append using "/Users/walter/Dropbox/ISSP_DATA/ISSP1995_selectedvars.dta", generate(y1995)

set scheme s1mono
svyset ID  [pweight = weight]

gen allwaves=country<24

* IO enforcement
* Q5b For certain problems, like environment pollution, international bodies should have the right to enforce solutions.
gen agree_enforce=enforce<3
replace agree_enforce=. if enforce>5
label var agree_enforce "Agree: IOs should enforce solutions"

gen disagree_enforce=enforce>3
replace disagree_enforce=. if enforce>5
label var disagree_enforce "Disagree: IOs should enforce solutions"

svy: tab agree_enfo if allwaves==1

svy: tab country agree_enforce, row
svy: tab country disagree_enforce, row

tab agree_enforce year if allwaves==1, col
tab disagree_enforce year if allwaves==1, col



* Too much IO power
* International organizations are taking away too much power from the [COUNTRY NATIONALITY] government.
gen agree_toomuchiopower=toomuchiopower<3
replace agree_toomuchiopower=. if toomuchiopower>5
label var agree_toomuchiopower "Agree: IOs take too much power"

gen disagree_toomuchiopower=toomuchiopower>3
replace disagree_toomuchiopower=. if toomuchiopower>5
label var disagree_toomuchiopower "Disagree: IOs take too much power"

svy: tab agree_toomuchiopower if allwaves==1
svy: tab agree_toomuchiopower agree_enfo if allwaves==1

tab agree_toomuchiopower year if allwaves==1, col
tab disagree_toomuchiopower year if allwaves==1, col



* Follow IO decision
* "Q6c In general, [COUNTRY] should follow the decisions of international organizations to which it belongs, even if the government does not agree with them."
gen agree_followio=followiodecision<3
replace agree_followio=. if followiodecision>5
label var agree_followio "Agree: Country should follow IO decisions"

gen disagree_followio=followiodecision>3
replace disagree_followio=. if followiodecision>5
label var disagree_followio "Disagree: Country should follow IO decisions"

svy: tab agree_followio if allwaves==1
svy: tab disagree_followio agree_enfo if allwaves==1

tab agree_followio year if allwaves==1, col
tab disagree_followio year if allwaves==1, col

tab agree_followio year if allwaves==1, col
tab disagree_followio year if allwaves==1, col


*******************	
**** Figure 1 *****
*******************

* IO Enforcement
ciplotm agree_enforce disagree_enforce if allwaves==1, ///
	by(year) subtitle("IOs should have right to enforce" "solutions for certain problems") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "% agree") label(3 "% disagree") region(lstyle(none))) ///
 name(enforce, replace) 

 * IOs have too much power
ciplotm disagree_toomuchiopower agree_toomuchiopower  if allwaves==1, ///
	by(year) subtitle("IOs take too much power" "from national government") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "% disagree") label(3 "% agree") region(lstyle(none))) ///
	name(iopower, replace) 
	
* Follow IO decisions	
ciplotm agree_followio disagree_followio   if allwaves==1, ///
	by(year) subtitle("Country should follow IO decisions" "despite disagreement") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "% agree") label(3 "% disagree") region(lstyle(none))) ///
	name(followio, replace) 

* Combined Graph (Figure 1)
graph combine  enforce followio iopower , ycommon rows(1)	



*** Supplementary Material: Difference between European and non-European countries
************************************************************************************

gen developed=0
replace developed=1 if country==1 
replace developed=1 if country==5 
replace developed=1 if country==7 
replace developed=1 if country==8 
replace developed=1 if country==10 
replace developed=1 if country==12 
replace developed=1 if country==14 
replace developed=1 if country==16 
replace developed=1 if country==17 
replace developed=1 if country==21 
replace developed=1 if country==23 
replace developed=1 if country==28 
replace developed=1 if country==29 
replace developed=1 if country==30 
replace developed=1 if country==32 
replace developed=1 if country==33 
label var developed "developed country (in 1995)"
label define developed 0 "Rest" 1 "developed"
label val developed developed

gen European=1
replace European=0 if country==2
replace European=0 if country==9
replace European=0 if country==14
replace European=0 if country==15
replace European=0 if country==16
replace European=0 if country==17
replace European=0 if country==20
replace European=0 if country==22
replace European=0 if country==24
replace European=0 if country==27
replace European=0 if country==31
replace European=0 if country==33
label var European "European country"
label define European 0 "Non-European" 1 "European"
label val European European

* Preliminary analysis
svy: tab agree_enforce developed if allwaves==1, col
svy: tab disagree_enforce developed if allwaves==1, col
svy: tab agree_enforce European if allwaves==1, col
svy: tab disagree_enforce European if allwaves==1, col

svy: tab agree_toomuchiopower developed if allwaves==1, col
svy: tab disagree_toomuchiopower European if allwaves==1, col

svy: tab agree_followio developed if allwaves==1, col
svy: tab disagree_followio developed if allwaves==1, col
svy: tab agree_followio European if allwaves==1, col
svy: tab disagree_followio European if allwaves==1, col


* IO enforcement
ciplotm agree_enforce disagree_enforce if allwaves==1 & European==1, ///
	by(year) title("European countries") ///
	subtitle("IOs should have right to enforce" "solutions for certain problems") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "% agree") label(3 "% disagree") region(lstyle(none))) ///
 name(enforce_eur, replace) 

ciplotm agree_enforce disagree_enforce if allwaves==1 & European==0, ///
	by(year) title("Non- European countries") ///
	subtitle("IOs should have right to enforce" "solutions for certain problems") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "% agree") label(3 "% disagree") region(lstyle(none))) ///
 name(enforce_noneur, replace)  

 
graph combine  enforce_eur enforce_noneur, ycommon col(1) name(enforce_eunoneur, replace)  
 
 
* Follow IO decisions
ciplotm agree_followio disagree_followio  if allwaves==1 & European==1, ///
	by(year) title("European countries") ///
	subtitle("Country should follow IO decisions" "despite disagreement") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "agree") label(3 "disagree") region(lstyle(none))) ///
 name(follow_eur, replace) 

ciplotm agree_followio disagree_followio  if allwaves==1 & European==0, ///
	by(year) title("Non-European countries") ///
	subtitle("Country should follow IO decisions" "despite disagreement") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "agree") label(3 "disagree") region(lstyle(none))) ///
 name(follow_noneur, replace)  

graph combine  follow_eur follow_noneur, ycommon col(1) name(follow_eunoneur, replace)  
  

  
* IOs too much power
ciplotm disagree_toomuchiopower agree_toomuchiopower  if allwaves==1 & European==0, ///
	by(year) title("European countries") ///
	subtitle("IOs take too much power" "from national government") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "agree") label(3 "disagree") region(lstyle(none))) ///
 name(toomuchiopower_eur, replace) 

ciplotm disagree_toomuchiopower agree_toomuchiopower if allwaves==1 & European==1, ///
	by(year) title("Non-European countries") ///
	subtitle("IOs take too much power" "from national government") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "disagree") label(3 "agree") region(lstyle(none))) ///
 name(toomuchiopower_noneur, replace)  

graph combine toomuchiopower_eur toomuchiopower_noneur, ycommon col(1) name(toomuchiopower_eunoneur, replace)  
   
*******************	
**** Figure S1 *****
*******************
graph combine enforce_eunoneur follow_eunoneur toomuchiopower_eunoneur,  row(1)
   
   



*** Difference between developed and less developed countries
* IO enforcement
ciplotm agree_enforce disagree_enforce if allwaves==1 & developed==1, ///
	by(year) title("Developed countries") ///
	subtitle("IOs should have right to enforce" "solutions for certain problems") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "agree") label(3 "disagree") region(lstyle(none))) ///
 name(enforce_dev, replace) 

ciplotm agree_enforce disagree_enforce if allwaves==1 & developed==0, ///
	by(year) title("Less Developed countries") ///
	subtitle("IOs should have right to enforce" "solutions for certain problems") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "agree") label(3 "disagree") region(lstyle(none))) ///
 name(enforce_ndev, replace)  

graph combine  enforce_dev enforce_ndev, ycommon col(1) name(enforce_develop, replace)  
 
 
* Follow IO decisions
ciplotm agree_followio disagree_followio  if allwaves==1 & developed==1, ///
	by(year) title("Developed countries") ///
	subtitle("Country should follow IO decisions" "despite disagreement") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "agree") label(3 "disagree") region(lstyle(none))) ///
 name(follow_dev, replace) 

ciplotm agree_followio disagree_followio  if allwaves==1 & developed==0, ///
	by(year) title("Less Developed countries") ///
	subtitle("Country should follow IO decisions" "despite disagreement") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "agree") label(3 "disagree") region(lstyle(none))) ///
 name(follow_ndev, replace)  

graph combine  follow_dev follow_ndev, ycommon col(1) name(follow_develop, replace)  
  

  
* IOs too much power
ciplotm disagree_toomuchiopower agree_toomuchiopower  if allwaves==1 & developed==1, ///
	by(year) title("Developed countries") ///
	subtitle("IOs take too much power" "from national government") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "agree") label(3 "disagree") region(lstyle(none))) ///
 name(toomuchiopower_dev, replace) 

ciplotm disagree_toomuchiopower agree_toomuchiopower if allwaves==1 & developed==0, ///
	by(year) title("Less Developed countries") ///
	subtitle("IOs take too much power" "from national government") ///
	msymbol(smcircle smsquare) mcolor(black gs10) connect(direct direct) ///
	legend(label(2 "disagree") label(3 "agree") region(lstyle(none))) ///
 name(toomuchiopower_ndev, replace)  

graph combine toomuchiopower_dev toomuchiopower_ndev, ycommon col(1) name(toomuchiopower_develop, replace)  
   
   
*******************	
*** Figure S2 *****
******************* 
graph combine enforce_develop follow_develop toomuchiopower_develop,  row(1)
   
   
   


